<?php

/**
 * job actions.
 *
 * @package    jobeet
 * @subpackage job
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class visualActions extends sfActions
{
  public function executeIndex(sfWebRequest $request)
  {
    $firstRequest = $this->getUser()->isFirstRequest();
    //To redirect to appropiate localized homepage
    if (!$request->getParameter('sf_culture'))
      {
        if ($firstRequest)
        {
          $culture = $request->getPreferredCulture(array('en', 'es'));
          $this->getUser()->setCulture($culture);
          $this->getUser()->isFirstRequest(false);
          $this->getUser()->setAttribute('id','tmp'.rand());
        }
        else
        {
          $culture = $this->getUser()->getCulture();
        }

        $this->redirect('@localized_homepage');
      }
      
      if($firstRequest){
        $this->getUser()->setAttribute('id','tmp'.rand());
      }
      $culture = $this->getUser()->getCulture();
  }

}